package com.sky.controller.admin;

import com.sky.dto.ReportTimeDto;
import com.sky.result.Result;
import com.sky.service.ReportService;
import com.sky.vo.OrderReportVO;
import com.sky.vo.TurnoverReportVO;
import com.sky.vo.UserReportVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * TODO
 *
 * @Author mr.wu
 * @Data #{DATE} #{TIME}
 */
@RestController
@RequestMapping("/admin/report")
public class ReportController {

    @Autowired
    private ReportService reportService;
    @GetMapping("/turnoverStatistics")
    public Result<TurnoverReportVO> turnoverStatistics(ReportTimeDto dto){
        TurnoverReportVO vo = reportService.turnoverStatistics(dto);
        return Result.success(vo);
    }

    @GetMapping("/userStatistics")
    public Result<UserReportVO> userStatistics(ReportTimeDto dto){
        UserReportVO vo = reportService.userStatistics(dto);
        return Result.success(vo);
    }

    @GetMapping("/ordersStatistics")
    public Result<OrderReportVO> ordersStatistics(ReportTimeDto dto){
        OrderReportVO vo = reportService.ordersStatistics(dto);
        return Result.success(vo);
    }



}
